﻿// Sigma ASC 105 LED Panel Control Library - http://www.codeplex.com/SigmaASC105lib/
// Copyright (c) Michal A. Valasek - Altairis, 2008 - http://www.altairis.cz/
// This code is licensed under terms of the Microsoft Public License (Ms-PL).

using System;
using Altairis.LedPanelControl;

namespace DemoProgram {
    class Program {
        private const string PortName = "COM1";

        static void Main(string[] args) {
            Console.WriteLine("-------------------------------------------------------------------------------");
            Console.WriteLine("Sigma ASC 105 Control Library DEMO      http://www.codeplex.com/SigmaASC105lib/");
            Console.WriteLine("Copyright (c) Altairis, 2008                            http://www.altairis.cz/");
            Console.WriteLine("-------------------------------------------------------------------------------");
            Console.WriteLine();
            Console.WriteLine("This program will demonstrate some capabilities of the control library on the");
            Console.WriteLine("Sigma ASC 105 LED display connected to port {0}.", PortName);
            Console.WriteLine();
            Console.WriteLine("To start, press ENTER!");
            Console.ReadLine();

using (Message msg = new Message(new LineTransitionOptions { Animation = AnimationType.ScrollUp, Color = Color.LayerMix, Font = Font.Fixed11x07 })) {
    msg.Write("DEMO OF");

    // Using several colors in one line (you can change the font using SetFont method as well)
    msg.WriteLine(new LineTransitionOptions { Font = Font.Fixed06x07, Color = Color.Red });
    msg.Write("SIGMA ");
    msg.SetColor(Color.Orange);
    msg.Write("ASC 105");

    msg.WriteLine(new LineTransitionOptions { Color = Color.Yellow });
    msg.Write("Control Lib");

    msg.WriteLine(new LineTransitionOptions { Color = Color.Orange, Animation = AnimationType.OpenFromSides });
    msg.Write(Glyph.ArrowRight);
    msg.SetColor(Color.Green);
    msg.Write("made by");
    msg.SetColor(Color.Orange);
    msg.Write(Glyph.ArrowLeft);

    msg.WriteLine(new LineTransitionOptions { Color = Color.Yellow, Font = Font.Fixed06x05 });
    msg.Write("Altairis LLC");

    msg.WriteLine(new LineTransitionOptions { Color = Color.Green, Font = Font.Fixed06x07 });
    msg.Write("http://www.codeplex.com/SigmaASC105lib/");

    msg.WriteLine(new LineTransitionOptions { Color = Color.Red, Animation = AnimationType.CoverFromCenter });
    msg.Write(SpecialFunction.CurrentDate);

    msg.WriteLine();
    msg.Write(SpecialFunction.CurrentTime);

    using (ControlClient client = new ControlClient(PortName)) {
        Console.Write("Sending {0} bytes to {1}...", msg.Length, PortName);
        client.SendMessage(msg);
        Console.WriteLine("OK");
    }
}
        }
    }
}
